package com.demo.alibaba.prototype;

/**
 * Created by yangshunxing on 2017/2/4.
 */
public class ConcretePrototype {
    private String  attr; //成员属性
    public void  setAttr(String attr)
    {
        this.attr = attr;
    }
    public String  getAttr()
    {
        return this.attr;
    }
    public ConcretePrototype  clone() //克隆方法
    {
       /* ConcretePrototype  prototype = new ConcretePrototype(); //创建新对象
        prototype.setAttr(this.attr);*/
        return this;
    }

    public static void main(String[] args) {
        ConcretePrototype concretePrototype = new ConcretePrototype();
        concretePrototype.setAttr("测试1");
        ConcretePrototype concretePrototype1 = concretePrototype.clone();
        System.out.println(concretePrototype1.getAttr());
    }
}
